
void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
    while(m>0 && n>0)
    {
        if(*(nums1+m-1)>*(nums2+n-1))
        {
            *(nums1+m+n-1)=*(nums1+m-1);
            m--;
        }
        else
        {
            *(nums1+m+n-1)=*(nums2+n-1);
            n--;
        }
    }
    while(n>0)
    {
        if(n>0)
    {
        *(nums1+n-1) = *(nums2+n-1);
        n--;
    }
    }
    
}

int removeElement(int* nums, int numsSize, int val) {
    int src=0;
    int dst=0;
    while(src<numsSize)
    {
        if(nums[src]==val)
        {
            src++;
        }
        else
        {
            nums[dts]=nums[src];
            scr++;
            dts++;
        }
    }
    return dst;
}

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */
 typedef struct ListNode ListNode;
struct ListNode* reverseList(struct ListNode* head) {
    if(head==NULL)
    return head;
    ListNode *p1=NULL;
    ListNode *p2=head;
    ListNode *p3=head->next;
    while(p2)
    {
        p2->next=p1;
        p1=p2;
        p2=p3;
        if(p2)
        p3=p3->next;
    }
    return p1;
}

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */
 typedef struct ListNode ListNode;
struct ListNode* removeElements(struct ListNode* head, int val) {
    ListNode *newTail;
    ListNode *newHead;
    ListNode *pcur=head;
    newHead=newTail=NULL;
    while(pcur)
    {
        
        if(pcur->val != val)
        {
            if(newHead == NULL)
            {
                newHead=newTail=pcur;
            }
            else
            {
                newTail->next=pcur;
                newTail=newTail->next;
            }
        }
        pcur=pcur->next;
    }
    if(newTail)
    {
        newTail->next=NULL;
    }
    return newHead;
}   

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */
 typedef struct ListNode ListNode;
struct ListNode* middleNode(struct ListNode* head) {
    ListNode *pcur;
    ListNode *prve;
    pcur=prve=head;
    while(prve && prve->next)
    {
        pcur=pcur->next;
        prve=prve->next->next;
    }
    return pcur;
}

int maximumCount(int* nums, int numsSize) {
    int count1=0;
    int count2=0;
    for(int i=0;i<numsSize;i++)
    {
        if(nums[i]<0)
        count1++;
        else if(nums[i] == 0)
        continue;
        else
        count2++;
    }
    return count1>count2?count1:count2;
}